package com.wc.AlgoOJ_train.train2.c1.DP0014;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/1/12 8:52
 * @description 最大和2
 * http://43.138.190.70:8888/p/DP0013
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        int t = sc.nextInt();
        while (t-- > 0) {
            int n = sc.nextInt();

            int start = 1;
            int ansStart = 1;
            int ansEnd = 1;
            int sum = 0;
            int ans = 0;
            int maxNum = -1001;
            int maxIdx = 0;
            for (int i = 1; i <= n; i++) {
                int num = sc.nextInt();
                // 全是负数的时候
                if (num > maxNum) {
                    maxNum = num;
                    maxIdx = i;
                }
                sum += num;
                if (sum == ans) {
                    if (i - start < ansEnd - ansStart) {
                        ansStart = start;
                        ansEnd = i;
                    }
                }
                if (sum > ans) {
                    ans = sum;
                    ansStart = start;
                    ansEnd = i;
                } else {
                    start = i + 1;
                    sum = 0;
                }
            }
            if (ans == 0) {
                out.println(maxNum + " " + maxIdx + " " + maxIdx);
            } else {
                out.println(ans + " " + ansStart + " " + ansEnd);
            }
        }
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }
}